import 'package:flutter/material.dart';
import 'package:mandoby/core/app_export.dart';
import 'package:mandoby/core/utils/app_colors.dart';
import 'package:nb_utils/nb_utils.dart';


class CustomScaffoldWidget extends StatelessWidget {
  const CustomScaffoldWidget(
      {Key? key,
      this.decoration,
      this.body,
      this.appBar,
      this.navBar,
      this.screenPadding})
      : super(key: key);

  final BoxDecoration? decoration;
  final Widget? body;
  final PreferredSizeWidget? appBar;
  final Widget? navBar;
  final EdgeInsetsGeometry? screenPadding;



  @override
  Widget build(BuildContext context) {
    return Scaffold(
  //    key: scaffoldStateKey,
      appBar: appBar,
      drawer: Drawer(
        child: Container(
          decoration: AppDecoration.gradientWhiteAToBlue200,
          child: ListView(
            children: [
              16.hs,
              Row(
                children: [
                  Container(
                    child: Icon(
                      Icons.close,
                      size: 30,
                      color: AppColors.whiteA700,
                    ),
                    margin: EdgeInsets.all(10),
                    decoration: BoxDecoration(
                        color: AppColors.primary,
                        borderRadius: BorderRadius.circular(7)
                    ),
                  ).onTap((){
                    finish(context);
                  }),

                  Spacer(),
                ],
              ),
              5.hs,

              Row(
                children: [
                  Spacer(),
                  CustomImageView(imagePath: AppAssets.imgRectangle22,height: 80.w,width: 150.w,fit: BoxFit.fill,),
                  50.ws,

                ],
              ),
              ...List.generate(5, (index) => ListTile(
                leading: Icon(Icons.home,color: AppColors.primary,),
                title: Text("الرئيسية",style: CustomTextStyles.font24bBlack400,),
              ))
            ],
          ),
        ),
      ),

      // drawer: Container(
      //   decoration: AppDecoration.gradientWhiteAToBlue200.copyWith(color: AppColors.whiteA700),
      //   width: MediaQuery.of(context).size.width - 100,
      //   child: Column(
      //     children: [
      //       ListTile(leading: Icon(Icons.abc),title: Text("dkhvlijlsi"),),
      //       ListTile(leading: Icon(Icons.abc),title: Text("dkhvlijlsi"),),
      //       ListTile(leading: Icon(Icons.abc),title: Text("dkhvlijlsi"),),
      //       ListTile(leading: Icon(Icons.abc),title: Text("dkhvlijlsi"),),
      //     ],
      //   ),
      // ),
      body: Container(
        padding: screenPadding,
        decoration: decoration,
        height: SizeUtils.height,
        width: SizeUtils.width,
        child: body,
      ),
      bottomNavigationBar: navBar,
    );
  }
}
